﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace COBAN
{
    class A {
        public virtual void TaoLaAi() {
            Console.WriteLine("Tao la thang A");
        }
    }
    class B:A {
        public override void TaoLaAi()
        {
            Console.WriteLine("Tao la thang B");
        }
    }
    class C:B {
        public override void TaoLaAi()
        {
            Console.WriteLine("Tao la thang C");
        }
    }
    class D:C {
        public override void TaoLaAi()
        {
            Console.WriteLine("Tao la thang D");
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            C c = new D();
            c.TaoLaAi();
            A a = new D();
            a.TaoLaAi();
            Console.ReadLine();
        }
    }
}
